package com.guangxia.test;

import java.util.Scanner;

public class test1 {
    public static void main(String[] args) {
        String username = "admin";
        String password = "123";
        Scanner sc = new Scanner(System.in);
        for(int i=1;i<=3;i++){
            System.out.println("请输入户名");
            String scUsername = sc.nextLine();
            System.out.println("请输入密码");
            String scPassword = sc.nextLine();
            if(username.equals(scUsername) &&  password.equals(scPassword)) {
                System.out.println("登录成功");
                break;
            }else{
                if(3==i){
                    System.out.println("你的登录输入已达到上限，请明天再来");
                }else{
                System.out.println("账户密码错误，还剩余"+(3-i)+"次机会");
        }
            }

    }


    }
}
